/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.search;

import com.aptech.entity.Contact;
import com.aptech.session.ContactFacadeLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author DucMinh
 */
@ManagedBean
@RequestScoped
public class SearchContactBean {
    @EJB
    private ContactFacadeLocal contactFacade;
private String field;
private Object value;
private List<Contact> listcontact;
    /** Creates a new instance of SearchContactBean */
    public SearchContactBean() {
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public List<Contact> getListcontact() {
        return listcontact;
    }

    public void setListcontact(List<Contact> listcontact) {
        this.listcontact = listcontact;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }
    public String searchcontact()
    {
        listcontact=contactFacade.searchContact(field, value);
        return "ResultContacts";
    }
    
}
